package com.mall;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

/**
 * Created by zhonglin on 2020/4/8.
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class Application {

  public static void main(String[] args) {

//    System.setProperty("spring.devtools.restart.enabled" , "false");
    ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class, args);

    outputInfo(applicationContext);

  }


  private static void outputInfo(ConfigurableApplicationContext applicationContext) {

    ConfigurableEnvironment environment = applicationContext.getEnvironment();
    String                  port        = environment.getProperty("server.port");
    System.out.println("mall is running...");
    System.out.println();
    System.out.println("----------------------------- Application Infomation -----------------------------");
    System.out.println();
    System.out.println("                          商城URL: http://127.0.0.1:" + port);
    System.out.println();
    System.out.println("---------------------------------- Running Log -----------------------------------");

  }

}